#include "new_module.h"
#include <stdlib.h>
#include <string.h>

int GetIndex()
{
    static int index = 0;
    return index++;
}

int main()
{
    Outter* p = (Outter*)malloc(sizeof(Outter));

    // 对二维的数据结构进行初始化
    p->columnCount = 100;
    p->eachRowLength = (int*)malloc(p->columnCount * sizeof(int));
    p->table = (int**)malloc(p->columnCount * sizeof(int*));
    for (int i = 0; i < p->columnCount; ++i) {
        p->eachRowLength[i] = 100 + i;
        p->table[i] = (int*)malloc(p->eachRowLength[i] * sizeof(int));
        for (int j = 0; j < p->eachRowLength[i]; ++j) {
            p->table[i][j] = j;
        }
    }

    // 对内层struct中的每个数组进行初始化
    for (int i = 0; i < 100; ++i) {
        p->innerArray[i].length = 100 + i;
        p->innerArray[i].data = (int*)malloc(p->innerArray[i].length * sizeof(int));
        memset(p->innerArray[i].data, 0, p->innerArray[i].length * sizeof(int));
    }
    
    // 传给新模块去处理
    ProcStruct(p);
    return 0;
}
